package com.hnas.trade.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.hnas.trade.dao.AbnormalOrderDao;
import com.hnas.trade.dto.DTORecord;
import com.hnas.trade.orm.AbnormalOrder;

@Component("abnormalOrderService")
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public class AbnormalOrderServiceImpl implements AbnormalOrderService{

	@Autowired
	private AbnormalOrderDao abnormalOrderDao;
	
	@Override
	public AbnormalOrder saveOrUpdate(AbnormalOrder vo) throws Exception {
		return this.abnormalOrderDao.saveOrUpdate(vo);
	}

	@Override
	public List<String> findAllAbnormalTranSnoByDate(String startDate, String endDate) {
		return abnormalOrderDao.findAllAbnormalTranSnoByDate(startDate,endDate);
	}

	@Override
	public List<AbnormalOrder> findByCondition(String account_id, String order_parent_type, String order_type,
			String date,int pageNo,int pageSize, String trade_status,boolean isToDay) {
		return abnormalOrderDao.findByCondition(account_id,order_parent_type,order_type,date,pageNo,pageSize,trade_status,isToDay);
	}

	@Override
	public List<DTORecord> unionFindByCondition(String account_id, String order_parent_type, String order_type,
			String date, String trade_status,Integer pageNo,Integer pageSize,boolean isByDate) {
		return abnormalOrderDao.unionFindByCondition(account_id,order_parent_type,order_type,date,trade_status,pageNo,pageSize,isByDate);
	}

	@Override
	public AbnormalOrder findByTranSno(String tranSno) {
		return abnormalOrderDao.findByTranSno(tranSno);
	}

	@Override
	public List<DTORecord> findTradeRecordList(String account_id, String cardNos, String order_parent_type,
			String order_type, String date, String trade_status, Integer pageNo, Integer pageSize, boolean isByDate) {
		return abnormalOrderDao.findTradeRecordList(account_id, cardNos, order_parent_type,
				order_type, date, trade_status, pageNo, pageSize, isByDate);
	}

	@Override
	public List<AbnormalOrder> findAbnormalOrderList(String account_id, String cardNos, String order_parent_type,
			String order_type, String last_tran_time, int i, int pageSize, String tran_state,
			boolean isQueryTodayData) {
		return abnormalOrderDao.findAbnormalOrderList(account_id,  cardNos,  order_parent_type,
				 order_type,  last_tran_time,  i,  pageSize,  tran_state,
				 isQueryTodayData);
	}

}
